GBML manual / Events

room_end

Runs once, as the room this instance is in stops being current - every non-persistent instance is then cleared before the next room loads.

Syntax

room_end: fires once per instance, as its room stops being current

Description

Runs once, as the room this instance is in stops being current - before the next room's instances are placed. Every non-persistent instance is cleared right after (its Cleanup follows), so Room End is the last chance for a non-persistent instance to hand anything off (writing to the save store, for instance) before it is gone for good. In a Persistent room the instances are set aside instead and no Cleanup follows; Room End still runs, and is the place to hide or destroy anything the instance made that lives outside the room.

Example

save_set("visited_arena", true);

Records that this room was visited before it - and, for a non-persistent instance, this instance itself - goes away.

See also: room_startpersistentcleanupEvents